/**
 *
 * @author Bora SAYINER
 * @since Dec 28, 2014 11:37:19 AM
 * @version 1.0
 */
public class StopWatch {

	private final Thread workerThread;

	public StopWatch() {
		this.workerThread = new Thread(new Runnable() {

			@Override
			public void run() {
				long begin = System.currentTimeMillis();
				while (true) {
					System.out.println("Thread ID: " + Thread.currentThread().getId());
//					try {
//						Thread.sleep(1000);
//					} catch (InterruptedException e) {
//						e.printStackTrace();
//					}
					long now = System.currentTimeMillis();
					System.out.println((now - begin) / 1000);
				}
			}
		});
		workerThread.setName("Onder's Thread");
	}

	public void start() {
		workerThread.start();
	}

}
